using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Chat.Server
{
    public partial class MainServer : Form
    {
        public MainServer()
        {
            InitializeComponent();
        }

        private void btnStartServer_Click(object sender, EventArgs e)
        {
            ChatServerAsync.startServer(this);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ChatServerAsync.Stop();
        }


        public void AppendText(string msg)
        {
            this.tbShowMsg.AppendText(msg + "\r\n");
        }        

        public void ClearText()
        {
            this.tbShowMsg.Text = "";
        }

        private void MainServer_FormClosing(object sender, FormClosingEventArgs e)
        {
            ChatServerAsync.Stop();
        }

    }
}